package kr.hkit.myframework.uicomp;

import javax.swing.JPanel;
import java.awt.GridLayout;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;

public class InputPanel extends JPanel {
	private static final long serialVersionUID = 1L;
	
	private JTextField tf;
	private JLabel lbl;

	public InputPanel() {
		initialize();
	}
	
	public InputPanel(String lblStr){
		initialize();
		lbl.setText(lblStr);
	}
	
	private void initialize() {
		setLayout(new GridLayout(0, 2, 10, 5));
		
		lbl = new JLabel("New label");
		lbl.setHorizontalAlignment(SwingConstants.RIGHT);
		add(lbl);
		
		tf = new JTextField();
		add(tf);
		tf.setColumns(10);
	}

	public JTextField getTf() {
		return tf;
	}

	public void setTfTxt(String text) {
		this.tf.setText(text);
	}

}
